<title>首页推荐</title>

<div class="layui-card layadmin-header">
<div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">控制台</a>
    <a><cite>问答管理</cite></a>
    <a><cite>首页推荐</cite></a>
</div>
</div>

<div class="layui-fluid">
  <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
          
      	<!--s-->
          <div class="layui-card">
          	<div class="layui-card-body">
          	
				<div class="layui-tab layui-tab-brief" lay-filter="component-tabs-brief">
		            <ul class="layui-tab-title">
		              <li class="layui-this"><a lay-href="wendasns/recommend/index">置顶推荐</a></li>
		              <li><a lay-href="wendasns/recommend/adpic">首页轮播图</a></li>
		            </ul>
		            <div class="layui-tab-content">
		              <div class="layui-tab-item layui-show">
		              	<blockquote class="layui-elem-quote">上移、下移可对推荐文章的排列顺序进行排序</blockquote>
				          <form class="layui-form" action="{:url('wendasns/recommend/post')}" method="post">

				            <div class="layui-form-item" name="item_top">
				              <label class="layui-form-label">置顶文章</label>
				              <div class="layui-input-inline">
				                <input type="text" name="top" value="{$top}" placeholder="输入文章ID" class="layui-input">
				              </div>
				            </div>
				            
				            <div class="layui-form-item">
				              <label class="layui-form-label">推荐文章</label>
				              <div class="layui-input-inline">
				                <input type="text" name="recommend[]" value="{$recommend[0]}" placeholder="输入文章ID" class="layui-input">
				              </div>
				              <div class="layui-form-mid layui-word-aux"><a href="javascript:;" class="item_up">上移</a> <a href="javascript:;" class="item_dowm">下移</a></div>
				            </div>
				            
				            <div class="layui-form-item">
				              <label class="layui-form-label">推荐文章</label>
				              <div class="layui-input-inline">
				                <input type="text" name="recommend[]" value="{$recommend[1]}" placeholder="输入文章ID" class="layui-input">
				              </div>
				              <div class="layui-form-mid layui-word-aux"><a href="javascript:;" class="item_up">上移</a> <a href="javascript:;" class="item_dowm">下移</a></div>
				            </div>

				            <div class="layui-form-item">
				              <label class="layui-form-label">推荐文章</label>
				              <div class="layui-input-inline">
				                <input type="text" name="recommend[]" value="{$recommend[2]}" placeholder="输入文章ID" class="layui-input">
				              </div>
				              <div class="layui-form-mid layui-word-aux"><a href="javascript:;" class="item_up">上移</a> <a href="javascript:;" class="item_dowm">下移</a></div>
				            </div>
				            
				            <div class="layui-form-item">
				              <label class="layui-form-label">推荐文章</label>
				              <div class="layui-input-inline">
				                <input type="text" name="recommend[]" value="{$recommend[3]}" placeholder="输入文章ID" class="layui-input">
				              </div>
				              <div class="layui-form-mid layui-word-aux"><a href="javascript:;" class="item_up">上移</a> <a href="javascript:;" class="item_dowm">下移</a></div>
				            </div>
				            
				            <div class="layui-form-item" name="item_bottom">
				              <div class="layui-input-block">
				                  <button class="layui-btn" lay-submit lay-filter="J_ajax_submit_btn"><i class="layui-icon layui-icon-ok-circle"></i>提交</button>
				              </div>
				            </div>
				            
				          </form>
		              </div>
		            </div>
		          </div>
          
          	</div>
          </div>
          <!--e-->
          
      </div>
  </div>
</div>
  
<script>
;!function(){
    var $ = layui.$
  ,form = layui.form;

  form.render();

	$('.item_up').click(function(){
		var parentDiv = $(this).parents('.layui-form-mid').parents('.layui-form-item');
		var prev = parentDiv.prev();
		if(prev.attr('name') == 'item_top'){
			return;
		}
		prev.fadeOut(0,function(){
			$(this).before(parentDiv);
		}).fadeIn();
	});
	
	$('.item_dowm').click(function(){
		var parentDiv = $(this).parents('.layui-form-mid').parents('.layui-form-item');
		var next = parentDiv.next();
		if(next.attr('name') == 'item_bottom'){
			return;
		}
		next.fadeOut(0,function(){
			$(this).after(parentDiv);
		}).fadeIn();
	});
	
}();
</script>